<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Ocean.OceanFramework.WPF">

    <Style TargetType="{x:Type local:ListBoxWithSelectedItemIndicator}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ListBoxWithSelectedItemIndicator}">
                    <ControlTemplate.Resources>
                        <!--this is where the default colors for the ListBox are changed-->
                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
                        <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="{x:Static SystemColors.ControlTextColor}" />

                    </ControlTemplate.Resources>
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="{TemplateBinding Padding}"
                            >

                        <DockPanel>
                            <!-- Hosts the selection indicator(s). -->
                            <Grid ClipToBounds="True" DockPanel.Dock="Left" Width="{TemplateBinding IndicatorHeightWidth}" Margin="0,0,1,0">
                                <ItemsControl x:Name="PART_IndicatorList" Focusable="False">
                                    <!-- Host all of the selection indicators within a Canvas panel. -->
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <Canvas />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>

                                    <!-- Position a selection indicator based on the offset value to which it is bound. -->
                                    <ItemsControl.ItemContainerStyle>
                                        <Style TargetType="ContentPresenter">
                                            <Setter Property="Canvas.Top" Value="{Binding Path=.}" />
                                        </Style>
                                    </ItemsControl.ItemContainerStyle>

                                    <!-- This renders a selection indicator. -->
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <Grid Width="{Binding Path=IndicatorHeightWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ListBoxWithSelectedItemIndicator}}}" Height="{Binding Path=IndicatorHeightWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ListBoxWithSelectedItemIndicator}}}">

                                                <!-- A lightweight drop shadow under the selection indicator. -->
                                                <Path Fill="LightGray" Stretch="Uniform" Data="M4,4 L16,10 L4,16 z" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True">
                                                    <Path.RenderTransform>
                                                        <TransformGroup>
                                                            <TranslateTransform X="2" Y="2"/>
                                                        </TransformGroup>
                                                    </Path.RenderTransform>
                                                </Path>

                                                <!-- The selection indicator itself. -->
                                                <Path Fill="{Binding Path=IndicatorBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ListBoxWithSelectedItemIndicator}}}" Stretch="Uniform" Data="M2,2 L14,8 L2,14 z" SnapsToDevicePixels="True"/>

                                            </Grid>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                            </Grid>

                            <!-- Here is our users list box-->
                            <ContentPresenter Content="{TemplateBinding Content}"/>

                        </DockPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>